/*  zwt */
package cn.mandy.sysadmin.model;

import cn.mandy.sysadmin.common.util.MandyTree;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;
import java.util.List;

public class MonitorJob implements MandyTree<MonitorJob> {
    private List<MonitorJob> children;
    private List<MonitorPlan> monitorPlans;
    private List<MonitorDependence> monitorDependencies;

    @Override
    public List<MonitorJob> getChildren() {
        return children;
    }

    @Override
    public void setChildren(List<MonitorJob> children) {
        this.children = children;
    }

    public List<MonitorPlan> getMonitorPlans() {
        return monitorPlans;
    }

    public void setMonitorPlans(List<MonitorPlan> monitorPlans) {
        this.monitorPlans = monitorPlans;
    }

    public List<MonitorDependence> getMonitorDependencies() {
        return monitorDependencies;
    }

    public void setMonitorDependencies(List<MonitorDependence> monitorDependencies) {
        this.monitorDependencies = monitorDependencies;
    }

    private Long id;

    @ApiModelProperty(value = "0 守护作业组,1, 守护作业 , 2,  普通作业组 3,  普通作业")
    private String jobType;

    @ApiModelProperty(value = "作业名称")
    private String jobName;

    @ApiModelProperty(value = "主机名称")
    private String hostName;

    @ApiModelProperty(value = "父级ID, 等于0的需要配置在crontab 才能被调用")
    private Long parentId;

    @ApiModelProperty(value = "组内顺序号, 可以并行执行的作业, 顺序号相同")
    private Integer ordinalPosition;

    @ApiModelProperty(value = "是否串行执行 0 并行 1 串行")
    private String serialProcessing;

    @ApiModelProperty(value = "流程控制顺序号, daemon都等于1，normal从1开始, 按组内作业并行还是串行自动赋值")
    private Integer ordinalPosition2;

    @ApiModelProperty(value = "有流程控制启动依赖")
    private String hasDependence;

    @ApiModelProperty(value = "日志文件,如非空表示有固定日志文件名")
    private String logFileName;

    @ApiModelProperty(value = "作业最大失败自动重启次数, 0 不进行自动重启")
    private Integer restartTimes;

    @ApiModelProperty(value = "作业失败自动重启时间间隔, 单位分钟 ")
    private Integer restartInterval;

    @ApiModelProperty(value = "运行命令")
    private String startCommand;

    @ApiModelProperty(value = "停止命令, KILL_PID 是特例,  特指用 kill 命令来杀进程")
    private String stopCommand;

    @ApiModelProperty(value = "最大运行时长")
    private Integer maxDuration;

    @ApiModelProperty(value = "组内最大并行任务数, 守护进程作业组此值固定为999")
    private Short maxParallel;

    @ApiModelProperty(value = "执行ps检查作业是否在运行的标识,多个用‘,’隔开")
    private String psKeyWords;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "状态：1 正常, 0 挂起")
    private String izEnabled;

    @ApiModelProperty(value = "删除标志 0 正常记录 1 已经删除记录")
    private String izDeleted;

    @ApiModelProperty(value = "扩展名称标识, 如kettle的jobname, transname等,用于关联日志文件")
    private String extName;

    private Date configTime;

    @ApiModelProperty(value = "当前实例进程号")
    private Integer realtimeInstancePid;

    @ApiModelProperty(value = "当前任务ID")
    private Long currentTaskId;

    private Date lastModifyTime;

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getJobType() {
        return jobType;
    }

    public void setJobType(String jobType) {
        this.jobType = jobType;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getHostName() {
        return hostName;
    }

    public void setHostName(String hostName) {
        this.hostName = hostName;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Integer getOrdinalPosition() {
        return ordinalPosition;
    }

    public void setOrdinalPosition(Integer ordinalPosition) {
        this.ordinalPosition = ordinalPosition;
    }

    public String getSerialProcessing() {
        return serialProcessing;
    }

    public void setSerialProcessing(String serialProcessing) {
        this.serialProcessing = serialProcessing;
    }

    public Integer getOrdinalPosition2() {
        return ordinalPosition2;
    }

    public void setOrdinalPosition2(Integer ordinalPosition2) {
        this.ordinalPosition2 = ordinalPosition2;
    }

    public String getHasDependence() {
        return hasDependence;
    }

    public void setHasDependence(String hasDependence) {
        this.hasDependence = hasDependence;
    }

    public String getLogFileName() {
        return logFileName;
    }

    public void setLogFileName(String logFileName) {
        this.logFileName = logFileName;
    }

    public Integer getRestartTimes() {
        return restartTimes;
    }

    public void setRestartTimes(Integer restartTimes) {
        this.restartTimes = restartTimes;
    }

    public Integer getRestartInterval() {
        return restartInterval;
    }

    public void setRestartInterval(Integer restartInterval) {
        this.restartInterval = restartInterval;
    }

    public String getStartCommand() {
        return startCommand;
    }

    public void setStartCommand(String startCommand) {
        this.startCommand = startCommand;
    }

    public String getStopCommand() {
        return stopCommand;
    }

    public void setStopCommand(String stopCommand) {
        this.stopCommand = stopCommand;
    }

    public Integer getMaxDuration() {
        return maxDuration;
    }

    public void setMaxDuration(Integer maxDuration) {
        this.maxDuration = maxDuration;
    }

    public Short getMaxParallel() {
        return maxParallel;
    }

    public void setMaxParallel(Short maxParallel) {
        this.maxParallel = maxParallel;
    }

    public String getPsKeyWords() {
        return psKeyWords;
    }

    public void setPsKeyWords(String psKeyWords) {
        this.psKeyWords = psKeyWords;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getIzEnabled() {
        return izEnabled;
    }

    public void setIzEnabled(String izEnabled) {
        this.izEnabled = izEnabled;
    }

    public String getIzDeleted() {
        return izDeleted;
    }

    public void setIzDeleted(String izDeleted) {
        this.izDeleted = izDeleted;
    }

    public String getExtName() {
        return extName;
    }

    public void setExtName(String extName) {
        this.extName = extName;
    }

    public Date getConfigTime() {
        return configTime;
    }

    public void setConfigTime(Date configTime) {
        this.configTime = configTime;
    }

    public Integer getRealtimeInstancePid() {
        return realtimeInstancePid;
    }

    public void setRealtimeInstancePid(Integer realtimeInstancePid) {
        this.realtimeInstancePid = realtimeInstancePid;
    }

    public Long getCurrentTaskId() {
        return currentTaskId;
    }

    public void setCurrentTaskId(Long currentTaskId) {
        this.currentTaskId = currentTaskId;
    }

    public Date getLastModifyTime() {
        return lastModifyTime;
    }

    public void setLastModifyTime(Date lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", jobType=").append(jobType);
        sb.append(", jobName=").append(jobName);
        sb.append(", hostName=").append(hostName);
        sb.append(", parentId=").append(parentId);
        sb.append(", ordinalPosition=").append(ordinalPosition);
        sb.append(", serialProcessing=").append(serialProcessing);
        sb.append(", ordinalPosition2=").append(ordinalPosition2);
        sb.append(", hasDependence=").append(hasDependence);
        sb.append(", logFileName=").append(logFileName);
        sb.append(", restartTimes=").append(restartTimes);
        sb.append(", restartInterval=").append(restartInterval);
        sb.append(", startCommand=").append(startCommand);
        sb.append(", stopCommand=").append(stopCommand);
        sb.append(", maxDuration=").append(maxDuration);
        sb.append(", maxParallel=").append(maxParallel);
        sb.append(", psKeyWords=").append(psKeyWords);
        sb.append(", remark=").append(remark);
        sb.append(", izEnabled=").append(izEnabled);
        sb.append(", izDeleted=").append(izDeleted);
        sb.append(", extName=").append(extName);
        sb.append(", configTime=").append(configTime);
        sb.append(", realtimeInstancePid=").append(realtimeInstancePid);
        sb.append(", currentTaskId=").append(currentTaskId);
        sb.append(", lastModifyTime=").append(lastModifyTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}